package com.spzx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.spzx.product.domain.ProductDetails;
import com.spzx.product.mapper.ProductDetailsMapper;
import com.spzx.product.service.ProductDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品sku属性表 服务实现类
 * </p>
 *
 * @author atguigu
 * @since 2025-04-28
 */
@Service
public class ProductDetailsServiceImpl extends ServiceImpl<ProductDetailsMapper, ProductDetails> implements ProductDetailsService {

    @Override
    public String[] getDetailsImageUrlList(Long productId) {
        LambdaQueryWrapper<ProductDetails> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ProductDetails::getProductId,productId);
        lambdaQueryWrapper.select(ProductDetails::getImageUrls);
        ProductDetails productDetails = baseMapper.selectOne(lambdaQueryWrapper);
        String[] split = productDetails.getImageUrls().split(",");
        return split;
    }
}
